1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gsk.c.types;
26 
27 public import cairo.c.types;
28 public import gdk.c.types;
29 public import glib.c.types;
30 public import gobject.c.types;
31 public import graphene.c.types;
32 public import pango.c.types;
33 
34 
35 /**
36  * The blend modes available for render nodes.
37  *
38  * The implementation of each blend mode is deferred to the
39  * rendering pipeline.
40  *
41  * See <https://www.w3.org/TR/compositing-1/#blending> for more information
42  * on blending and blend modes.
43  */
44 public enum GskBlendMode
45 {
46 	/**
47 	 * The default blend mode, which specifies no blending
48 	 */
49 	DEFAULT = 0,
50 	/**
51 	 * The source color is multiplied by the destination
52 	 * and replaces the destination
53 	 */
54 	MULTIPLY = 1,
55 	/**
56 	 * Multiplies the complements of the destination and source
57 	 * color values, then complements the result.
58 	 */
59 	SCREEN = 2,
60 	/**
61 	 * Multiplies or screens the colors, depending on the
62 	 * destination color value. This is the inverse of hard-list
63 	 */
64 	OVERLAY = 3,
65 	/**
66 	 * Selects the darker of the destination and source colors
67 	 */
68 	DARKEN = 4,
69 	/**
70 	 * Selects the lighter of the destination and source colors
71 	 */
72 	LIGHTEN = 5,
73 	/**
74 	 * Brightens the destination color to reflect the source color
75 	 */
76 	COLOR_DODGE = 6,
77 	/**
78 	 * Darkens the destination color to reflect the source color
79 	 */
80 	COLOR_BURN = 7,
81 	/**
82 	 * Multiplies or screens the colors, depending on the source color value
83 	 */
84 	HARD_LIGHT = 8,
85 	/**
86 	 * Darkens or lightens the colors, depending on the source color value
87 	 */
88 	SOFT_LIGHT = 9,
89 	/**
90 	 * Subtracts the darker of the two constituent colors from the lighter color
91 	 */
92 	DIFFERENCE = 10,
93 	/**
94 	 * Produces an effect similar to that of the difference mode but lower in contrast
95 	 */
96 	EXCLUSION = 11,
97 	/**
98 	 * Creates a color with the hue and saturation of the source color and the luminosity of the destination color
99 	 */
100 	COLOR = 12,
101 	/**
102 	 * Creates a color with the hue of the source color and the saturation and luminosity of the destination color
103 	 */
104 	HUE = 13,
105 	/**
106 	 * Creates a color with the saturation of the source color and the hue and luminosity of the destination color
107 	 */
108 	SATURATION = 14,
109 	/**
110 	 * Creates a color with the luminosity of the source color and the hue and saturation of the destination color
111 	 */
112 	LUMINOSITY = 15,
113 }
114 alias GskBlendMode BlendMode;
115 
116 /**
117  * The corner indices used by `GskRoundedRect`.
118  */
119 public enum GskCorner
120 {
121 	/**
122 	 * The top left corner
123 	 */
124 	TOP_LEFT = 0,
125 	/**
126 	 * The top right corner
127 	 */
128 	TOP_RIGHT = 1,
129 	/**
130 	 * The bottom right corner
131 	 */
132 	BOTTOM_RIGHT = 2,
133 	/**
134 	 * The bottom left corner
135 	 */
136 	BOTTOM_LEFT = 3,
137 }
138 alias GskCorner Corner;
139 
140 /**
141  * This defines the types of the uniforms that `GskGLShaders`
142  * declare.
143  *
144  * It defines both what the type is called in the GLSL shader
145  * code, and what the corresponding C type is on the Gtk side.
146  */
147 public enum GskGLUniformType
148 {
149 	/**
150 	 * No type, used for uninitialized or unspecified values.
151 	 */
152 	NONE = 0,
153 	/**
154 	 * A float uniform
155 	 */
156 	FLOAT = 1,
157 	/**
158 	 * A GLSL int / gint32 uniform
159 	 */
160 	INT = 2,
161 	/**
162 	 * A GLSL uint / guint32 uniform
163 	 */
164 	UINT = 3,
165 	/**
166 	 * A GLSL bool / gboolean uniform
167 	 */
168 	BOOL = 4,
169 	/**
170 	 * A GLSL vec2 / graphene_vec2_t uniform
171 	 */
172 	VEC2 = 5,
173 	/**
174 	 * A GLSL vec3 / graphene_vec3_t uniform
175 	 */
176 	VEC3 = 6,
177 	/**
178 	 * A GLSL vec4 / graphene_vec4_t uniform
179 	 */
180 	VEC4 = 7,
181 }
182 alias GskGLUniformType GLUniformType;
183 
184 /**
185  * The type of a node determines what the node is rendering.
186  */
187 public enum GskRenderNodeType
188 {
189 	/**
190 	 * Error type. No node will ever have this type.
191 	 */
192 	NOT_A_RENDER_NODE = 0,
193 	/**
194 	 * A node containing a stack of children
195 	 */
196 	CONTAINER_NODE = 1,
197 	/**
198 	 * A node drawing a `cairo_surface_t`
199 	 */
200 	CAIRO_NODE = 2,
201 	/**
202 	 * A node drawing a single color rectangle
203 	 */
204 	COLOR_NODE = 3,
205 	/**
206 	 * A node drawing a linear gradient
207 	 */
208 	LINEAR_GRADIENT_NODE = 4,
209 	/**
210 	 * A node drawing a repeating linear gradient
211 	 */
212 	REPEATING_LINEAR_GRADIENT_NODE = 5,
213 	/**
214 	 * A node drawing a radial gradient
215 	 */
216 	RADIAL_GRADIENT_NODE = 6,
217 	/**
218 	 * A node drawing a repeating radial gradient
219 	 */
220 	REPEATING_RADIAL_GRADIENT_NODE = 7,
221 	/**
222 	 * A node drawing a conic gradient
223 	 */
224 	CONIC_GRADIENT_NODE = 8,
225 	/**
226 	 * A node stroking a border around an area
227 	 */
228 	BORDER_NODE = 9,
229 	/**
230 	 * A node drawing a `GdkTexture`
231 	 */
232 	TEXTURE_NODE = 10,
233 	/**
234 	 * A node drawing an inset shadow
235 	 */
236 	INSET_SHADOW_NODE = 11,
237 	/**
238 	 * A node drawing an outset shadow
239 	 */
240 	OUTSET_SHADOW_NODE = 12,
241 	/**
242 	 * A node that renders its child after applying a matrix transform
243 	 */
244 	TRANSFORM_NODE = 13,
245 	/**
246 	 * A node that changes the opacity of its child
247 	 */
248 	OPACITY_NODE = 14,
249 	/**
250 	 * A node that applies a color matrix to every pixel
251 	 */
252 	COLOR_MATRIX_NODE = 15,
253 	/**
254 	 * A node that repeats the child's contents
255 	 */
256 	REPEAT_NODE = 16,
257 	/**
258 	 * A node that clips its child to a rectangular area
259 	 */
260 	CLIP_NODE = 17,
261 	/**
262 	 * A node that clips its child to a rounded rectangle
263 	 */
264 	ROUNDED_CLIP_NODE = 18,
265 	/**
266 	 * A node that draws a shadow below its child
267 	 */
268 	SHADOW_NODE = 19,
269 	/**
270 	 * A node that blends two children together
271 	 */
272 	BLEND_NODE = 20,
273 	/**
274 	 * A node that cross-fades between two children
275 	 */
276 	CROSS_FADE_NODE = 21,
277 	/**
278 	 * A node containing a glyph string
279 	 */
280 	TEXT_NODE = 22,
281 	/**
282 	 * A node that applies a blur
283 	 */
284 	BLUR_NODE = 23,
285 	/**
286 	 * Debug information that does not affect the rendering
287 	 */
288 	DEBUG_NODE = 24,
289 	/**
290 	 * A node that uses OpenGL fragment shaders to render
291 	 */
292 	GL_SHADER_NODE = 25,
293 }
294 alias GskRenderNodeType RenderNodeType;
295 
296 /**
297  * The filters used when scaling texture data.
298  *
299  * The actual implementation of each filter is deferred to the
300  * rendering pipeline.
301  */
302 public enum GskScalingFilter
303 {
304 	/**
305 	 * linear interpolation filter
306 	 */
307 	LINEAR = 0,
308 	/**
309 	 * nearest neighbor interpolation filter
310 	 */
311 	NEAREST = 1,
312 	/**
313 	 * linear interpolation along each axis,
314 	 * plus mipmap generation, with linear interpolation along the mipmap
315 	 * levels
316 	 */
317 	TRILINEAR = 2,
318 }
319 alias GskScalingFilter ScalingFilter;
320 
321 /**
322  * Errors that can happen during (de)serialization.
323  */
324 public enum GskSerializationError
325 {
326 	/**
327 	 * The format can not be identified
328 	 */
329 	UNSUPPORTED_FORMAT = 0,
330 	/**
331 	 * The version of the data is not
332 	 * understood
333 	 */
334 	UNSUPPORTED_VERSION = 1,
335 	/**
336 	 * The given data may not exist in
337 	 * a proper serialization
338 	 */
339 	INVALID_DATA = 2,
340 }
341 alias GskSerializationError SerializationError;
342 
343 /**
344  * The categories of matrices relevant for GSK and GTK.
345  *
346  * Note that any category includes matrices of all later categories.
347  * So if you want to for example check if a matrix is a 2D matrix,
348  * `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
349  *
350  * Also keep in mind that rounding errors may cause matrices to not
351  * conform to their categories. Otherwise, matrix operations done via
352  * multiplication will not worsen categories. So for the matrix
353  * multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
354  */
355 public enum GskTransformCategory
356 {
357 	/**
358 	 * The category of the matrix has not been
359 	 * determined.
360 	 */
361 	UNKNOWN = 0,
362 	/**
363 	 * Analyzing the matrix concluded that it does
364 	 * not fit in any other category.
365 	 */
366 	ANY = 1,
367 	/**
368 	 * The matrix is a 3D matrix. This means that
369 	 * the w column (the last column) has the values (0, 0, 0, 1).
370 	 */
371 	_3D = 2,
372 	/**
373 	 * The matrix is a 2D matrix. This is equivalent
374 	 * to graphene_matrix_is_2d() returning %TRUE. In particular, this
375 	 * means that Cairo can deal with the matrix.
376 	 */
377 	_2D = 3,
378 	/**
379 	 * The matrix is a combination of 2D scale
380 	 * and 2D translation operations. In particular, this means that any
381 	 * rectangle can be transformed exactly using this matrix.
382 	 */
383 	_2D_AFFINE = 4,
384 	/**
385 	 * The matrix is a 2D translation.
386 	 */
387 	_2D_TRANSLATE = 5,
388 	/**
389 	 * The matrix is the identity matrix.
390 	 */
391 	IDENTITY = 6,
392 }
393 alias GskTransformCategory TransformCategory;
394 
395 struct GskBlendNode;
396 
397 struct GskBlurNode;
398 
399 struct GskBorderNode;
400 
401 struct GskBroadwayRenderer;
402 
403 struct GskBroadwayRendererClass;
404 
405 struct GskCairoNode;
406 
407 struct GskCairoRenderer;
408 
409 struct GskCairoRendererClass;
410 
411 struct GskClipNode;
412 
413 struct GskColorMatrixNode;
414 
415 struct GskColorNode;
416 
417 /**
418  * A color stop in a gradient node.
419  */
420 struct GskColorStop
421 {
422 	/**
423 	 * the offset of the color stop
424 	 */
425 	float offset;
426 	/**
427 	 * the color at the given offset
428 	 */
429 	GdkRGBA color;
430 }
431 
432 struct GskConicGradientNode;
433 
434 struct GskContainerNode;
435 
436 struct GskCrossFadeNode;
437 
438 struct GskDebugNode;
439 
440 struct GskGLRenderer;
441 
442 struct GskGLRendererClass;
443 
444 struct GskGLShader;
445 
446 struct GskGLShaderClass
447 {
448 	GObjectClass parentClass;
449 }
450 
451 struct GskGLShaderNode;
452 
453 struct GskInsetShadowNode;
454 
455 struct GskLinearGradientNode;
456 
457 struct GskNglRenderer;
458 
459 struct GskOpacityNode;
460 
461 struct GskOutsetShadowNode;
462 
463 /**
464  * A location in a parse buffer.
465  */
466 struct GskParseLocation
467 {
468 	/**
469 	 * the offset of the location in the parse buffer, as bytes
470 	 */
471 	size_t bytes;
472 	/**
473 	 * the offset of the location in the parse buffer, as characters
474 	 */
475 	size_t chars;
476 	/**
477 	 * the line of the location in the parse buffer
478 	 */
479 	size_t lines;
480 	/**
481 	 * the position in the line, as bytes
482 	 */
483 	size_t lineBytes;
484 	/**
485 	 * the position in the line, as characters
486 	 */
487 	size_t lineChars;
488 }
489 
490 struct GskRadialGradientNode;
491 
492 struct GskRenderNode;
493 
494 struct GskRenderer;
495 
496 struct GskRendererClass;
497 
498 struct GskRepeatNode;
499 
500 struct GskRepeatingLinearGradientNode;
501 
502 struct GskRepeatingRadialGradientNode;
503 
504 struct GskRoundedClipNode;
505 
506 struct GskRoundedRect
507 {
508 	/**
509 	 * the bounds of the rectangle
510 	 */
511 	graphene_rect_t bounds;
512 	/**
513 	 * the size of the 4 rounded corners
514 	 */
515 	graphene_size_t[4] corner;
516 }
517 
518 struct GskShaderArgsBuilder;
519 
520 /**
521  * The shadow parameters in a shadow node.
522  */
523 struct GskShadow
524 {
525 	/**
526 	 * the color of the shadow
527 	 */
528 	GdkRGBA color;
529 	/**
530 	 * the horizontal offset of the shadow
531 	 */
532 	float dx;
533 	/**
534 	 * the vertical offset of the shadow
535 	 */
536 	float dy;
537 	/**
538 	 * the radius of the shadow
539 	 */
540 	float radius;
541 }
542 
543 struct GskShadowNode;
544 
545 struct GskTextNode;
546 
547 struct GskTextureNode;
548 
549 struct GskTransform;
550 
551 struct GskTransformNode;
552 
553 /**
554  * Type of callback that is called when an error occurs
555  * during node deserialization.
556  *
557  * Params:
558  *     start = start of the error location
559  *     end = end of the error location
560  *     error = the error
561  *     userData = user data
562  */
563 public alias extern(C) void function(GskParseLocation* start, GskParseLocation* end, GError* error, void* userData) GskParseErrorFunc;